home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / vbcc-src / doc / vc.doc < prev    next >
Text File  |  1999-01-01  |  7KB  |  185 lines

  1. vc - frontend for vbcc (c) in 1995-99 by Volker Barthelmann
  2.  
  3.  
  4. INTRODUCTION
  5.  
  6.     vc calls the preprocessor, compiler, assembler and linker.
  7.     It should be somewhat Unix cc compatible.
  8.  
  9.  
  10. LEGAL
  11.  
  12.     vc is (c) in 1995-99 by Volker Barthelmann. All code is written by me
  13.     and may be freely redistributed as long as no modifications are made
  14.     and nothing is charged for it.
  15.  
  16.  
  17. INSTALLATION
  18.  
  19.     This may change in following versions.
  20.  
  21.     First do not set your stack too low (if your operating systems needs
  22.     specifying a stack size). I have not tested how much stack vbcc needs,
  23.     some 10k will probably be enough.
  24.  
  25.     At the moment vc calls an external preprocessor, so this one must be
  26.     in the path and you probably have to tell the preprocessor the
  27.     directories that contain the vbcc includes (and any os includes, if you
  28.     have them).
  29.  
  30.     vc needs a config file which tells it how to call all the translation
  31.     phases (preprocessor, compiler, assembler, linker). The locations where
  32.     vc searches for config files depend on how it was compiled.
  33.     On the Amiga it will usually search for "vc.config" in the current
  34.     directory, then in ENV: and VBCC:.
  35.     On Unix it will search for vc.config in the current directory followed
  36.     by /etc/vc.config.
  37.     Those locations can be changed by modifying config_names in vc.c and
  38.     rebuilding it.
  39.  
  40.     The following options can be used to tell vc how to call the translation
  41.     phases (they will usually be contained in the config-file):
  42.  
  43.     -pp=string  The preprocessor will be called like in
  44.                 printf(string,opts,infile,outfile), e.g. the default for vcpp
  45.                 searching the includes in vinclude: and defining __STDC__)
  46.                 is "-pp=vcpp -Ivinclude: -D__STDC__=1 %s %s %s"
  47.  
  48.     -cc=string  For the compiler. Note that you cannot use vc to call
  49.                 another compiler than vbcc. But you can call different
  50.                 versions of vbcc this way, e.g.:
  51.                 "-cc=vbcca68k -quiet" or
  52.                 "-cc=vbcci386 -quiet"
  53.  
  54.     -isc=string The same for the scheduler, e.g.:
  55.                 "-isc=vscppc -quiet %s %s"
  56.                 Omit, if there is no scheduler for the architecture.
  57.  
  58.     -as=string  The same for the assembler, e.g.:
  59.                 "-as=PhxAss opt NRQBTLPSM quiet %s to %s" or
  60.                 "-as=as %s -o %s"
  61.  
  62.     -rm=string  This is the string for the delete command and takes only
  63.                 one argument, e.g.
  64.                 "-rm=delete quiet %s" or
  65.                 "-rm=rm %s"
  66.  
  67.     -ld=string  This is for the linker and takes three arguments. The first
  68.                 one are the object files (separated by spaces), the second
  69.                 one the user specified libraries and the last one the name
  70.                 of the resulting executable.
  71.                 This has to link with proper startup-code and c-libraries,
  72.                 e.g.:
  73.                 "-ld=PhxLnk vlib:startup.o %s %s vlib:vc.lib vlib:amiga.lib
  74.                  to %s" or
  75.                 "-ld=ld /usr/lib/crt0.o %s %s -lc -o %s"
  76.  
  77.     -l2=string  The same like -ld, but standard-startup and -libraries should
  78.                 not be linked; used when -nostdlib is specified.
  79.  
  80.     All those strings should tell the command to omit any output apart from
  81.     error messages if possible. However for every of those options there
  82.     exists one with an additional 'v', i.e. -ppv=, -asv=, etc. which should
  83.     produce some output, if possible.
  84.     If vc is invoked with the -vv option the verbose commands will be called,
  85.     if not the quiet ones will be used.
  86.  
  87.     -ul=string  Format for additional libraries specified with -l<lib>.
  88.                 The result of printf(string,lib) will be added to the
  89.                 command invoking the linker. Examples are:
  90.                 "-ul=vlib:%s.lib" or "-ul=-l%s"
  91.  
  92.  
  93. CONFIG
  94.  
  95.     vc looks for a config file named 'vc.config' in the current directory
  96.     first and then in some other files which have been specified
  97.     while compiling vc (on the Amiga this will be ENV:vc.config then
  98.     VBCC:vc.config; on Unix systems /etc/vc.config). If it is found it will
  99.     be treated as a collection of additional command line arguments. Every
  100.     line of the file will be used as one argument. So no quoting shall be
  101.     used and furthermore must each argument be placed on its own line.
  102.     There should be an example vc.config.
  103.  
  104.     If the _first_ argument of vc is '+file' then <file> will be used as
  105.     config-file.
  106.  
  107.  
  108. USAGE
  109.  
  110.     vc [options] file1 file2 ...
  111.  
  112.     Processes all files according to their suffix and links all objects
  113.     together (unless any of -E, -S, -c is specified). It recognizes the
  114.     following file types:
  115.  
  116.     .c      C source
  117.     .i      already preprocessed C source
  118.     .scs    assembly source to be fed to the scheduler
  119.     .asm
  120.     .s      assembly source
  121.     .obj
  122.     .o      object file
  123.  
  124.     Usually pattern matching is supported - however this depends on the
  125.     port and the host system.
  126.  
  127.     The options recognized by vc are:
  128.  
  129.     -v      verbose; print all commands
  130.  
  131.     -vv     very verbose; display some internals, aswell
  132.  
  133.     -Ox     optimization level
  134.             -O0 is equivalent to -O=0
  135.             -O  will activate some optimizations (at the moment -O=991)
  136.             -O2 will activate most optimizations (at the moment -O=1023 -schedule)
  137.             -O3 will activate all  optimizations (at the moment -O=~0 -schedule)
  138.  
  139.             Higher values may or may not activate even more optimizations.
  140.             The default is -O=1.
  141.             It is also possible to specify an exact value with -O=n.
  142.             However, I do not recommend this unless you know exactly what
  143.             you are doing.
  144.  
  145.     -o file save target as file (default for executables is a.out)
  146.  
  147.     -E      do not compile, save the preprocessed C sources with .i suffix
  148.  
  149.     -S      do not assemble, save the compiled files with .asm suffix
  150.  
  151.     -SCS    do not schedule, save the compiled files with .scs suffix
  152.  
  153.     -c      do not link, save the compiled files with .o suffix
  154.  
  155.     -k      keep all intermediate files; by default all generated files
  156.             except the source files and the targets are deleted
  157.  
  158.     -Dstr   #define a preprocessor symbol, e.g. -DAMIGA or -DCPU=68000;
  159.             at the moment this is passed through to the preprocessor
  160.  
  161.     -Ipath  add path to the include-search-path;
  162.             at the moment this is passed through to the preprocessor
  163.  
  164.     -lulib  link with library ulib
  165.  
  166.     -+      allow C++ comments;
  167.             when used at the end of the command line on Amiga this option
  168.             has to be enclosed in quotation-marks
  169.  
  170.     -nostdlib   do not link with standard-startup/libraries; useful only
  171.                 for people who know what they are doing
  172.  
  173.     -notmpfile  do not use names from tmpnam() for temporary files
  174.  
  175.     -schedule   do instruction-scheduling
  176.  
  177.     +file   use file as config-file
  178.  
  179.  
  180.     All other options are passed through to vbcc.
  181.  
  182.  
  183. Volker Barthelmann                                      volker@vb.franken.de
  184.  
  185.